# 练习题
# list1 = [1, 2, 1, 3, 5, 5]
# list2 = set(list1)
# print(list2)

# list3 = []
# for i in list1:
#     if i not in list3:
#         list3.append(i)
# print(list3)

# 第二题
# lst = []


# with open('text.txt','r',encoding='utf8') as f:
#     for i in f.readlines():
#         lst_2 = i.split(",")
#         tup = tuple([int(j.strip()) for j in lst_2])
#         lst.append(tup)
# print(lst)
#
# with open('text.txt') as f:
#     data_lst = [tuple([int(j.strip()) for j in i.split(",")]) for i in f.readlines()]
# print(data_lst)


# 爬虫
# import requests
#
# url = "https://gank.io/images/f4f6d68bf30147e1bdd4ddbc6ad7c2a2"
# url_1 = "https://gank.io/images/6b2efa591564475fb8bc32291fb0007c"
# src = requests.get(url=url_1)
# print(src)
#
# content = src.content
# with open("xxx.jpg",'wb') as f:
#     f.write(content)


# 爬图片
# import re
# import time
# import requests
# import uuid
#
# url_page = "https://m.mm.enterdesk.com/oumeimeinv/"
# res = requests.get(url=url_page)
# url_lst = re.findall(r"https://up.enterdesk.com/edpic_360_360/.*?\.jpg", res.text)

# print(url_lst)
# 发送请求
# for url in url_lst:
#     res = requests.get(url=url)
#     time.sleep(1)
#     # 将响应数据转化为二进制流数据
#     countent = res.content
#     # 将二进制数据写入文件
#     name = str(uuid.uuid1()) + '.jpg'
#     with open(name, 'wb') as f:
#         print("正在下载%s" % name)
#         f.write(countent)

# 练习题
# 找到里面唯一不重复的 不能使用count
# lst_1 = [1, 2, 2, 1, 3]
# lst_2 = []
#
# list_new = list(set(lst_1))
# for i in list_new:
#     c = 0
#     for j in lst_1:
#         if j == i:
#             c += 1
#     if c == 1:
#         lst_2.append(c)
# print(lst_2)

#
# list1 = [1, 1, 2, 3, 3]  # 去重
# list2 = []
# list3 = []
# for i in list1:
#     if i not in list2:
#         list2.append(i)
#     for k in list2:  # 输出没有重复的数字
#         cont = 0
#         for j in list1:
#             if j == i:
#                 cont += 1
#         if cont == 1:
#             list3.append(i)
#             break
# print(list3)


#
# def func(h, n):
#     a1 = h / 3
#     an = a1 * (1 / 3 ** (n - 1))
#     sn = (a1 - an * (1 / 3) / (1 - 1 / 3))
#     print(an, sn)
#
#
# 循环
# import time
#
# s = time.time()
# list_1 = []
# for i in range(100001):
#     list_1.append(i)
#     print(i)
# e = time.time()
# print(e - s)
#
# import time
#
# s = time.time()
# list_1 = [i for i in range(100001)]
# e = time.time()
# print(e - s)


# 1.青蛙跳台阶
# 一只青蛙一次可以跳上一级台阶,也可以一次跳上两级台阶:问:如果一n级的台阶有多少种跳法


# 2.给定一个列表和一个数求列表总中哪个索引位置的元素之和与给定的这个数相等


# 3.给4个数1,2,3,4能组成多少个不重复的三位数


# 4.给定一个数组 判断其内无重复的元素,有重复返回False,无重复返回True




















